using System;
using System.Collections.Generic;
using System.Text;
using JobShopModel.Model.FactoryLvl;

namespace JobShopModel.Model
{
    /// <summary>
    /// 
    /// </summary>
    public class LogItem:IComparable<LogItem>
    {
        private Time timeStamp;
        private ItemPriorities priority;
        private string message;

        public LogItem(ItemPriorities priority, Time timeStamp, string message)
        {
            this.message = message;
            this.timeStamp = timeStamp;
            this.priority = priority;

        }

        public override string ToString()
        {
            return String.Format("({0}:{1:0.##}) >> {2}", timeStamp.Days, timeStamp.Hours, message);
        }

        #region Properties

        public ItemPriorities Priority
        {
            get { return this.priority; }
        }

        public string Message
        {
            get { return this.message; }
        }

        public Time TimeStamp
        {
            get { return this.timeStamp; }
        }

        #endregion Properties


        #region IComparable<LogItem> Membres

        public int CompareTo(LogItem other)
        {
            return this.timeStamp.CompareTo(other.TimeStamp);
        }

        #endregion
    }

}
